<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="javax.servlet.http.Cookie" %>    
<%@ page import="java.net.*" %>  
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>论文题目提交</title>
<link rel="stylesheet" type="text/css" href="<c:url value='/css/style.css'/>">
<link rel="stylesheet" type="text/css" href="<c:url value='/css/common.css'/>">
<script type="text/javascript" src="<c:url value='/js/jquery-1.8.3.min.js'/>"></script>
</head>
<body>
	<div class="m-right">
		<div class="right-nav">
			<ul>
				<li><img src="<c:url value='/images/home.png'/>"></li>
				<li style="margin-left: 25px;">您当前的位置：</li>
				<li><a href="#">提交</a></li>
				<li>&gt;</li>
				<li><a href="#">论文题目提交</a></li>
			</ul>
		</div>
		<div class="main">
			<div>
				<span><font color="red">${requestScope.msg }</font></span>
				<form action="<c:url value='/thesis'/>" method="post">
					论题：<input type="text" name="thesisName" value="${requestScope.thesis.thesisName }"/><br>
					描述：<input type="text" name="thesisContent" value="${requestScope.thesis.thesisContent }"/><br>
					所属专业：
						<select id="thesis_list" name="specialtyId">
							<option>请选择</option>
						</select>
						<br>
					<input type="submit" value="提交">
				</form>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$(function() {
		//异步加载专业下拉框
		var ele = $("#thesis_list");
			ele.empty();
			$.ajax({
				   type: "GET",
				   url: "<c:url value='/specialtys'/>",
				   success: function(result){
					   if(result.status == 200) {
						   $.each(result.data,function(){
								var optionEle = $("<option></option>").append(this.specialtyName).attr("value",this.specialtyId);
								optionEle.appendTo(ele);
							});
					   }
				   }
				});
		
	/* $("#thesis_list").click(function() {
			var ele = $("#thesis_list");
			ele.empty();
			$.ajax({
				   type: "GET",
				   url: "<c:url value='/specialtys'/>",
				   success: function(result){
					   if(result.status == 200) {
						   $.each(result.data,function(){
								var optionEle = $("<option></option>").append(this.specialtyName).attr("value",this.specialtyId);
								optionEle.appendTo(ele);
							});
					   }
				   }
				});
		});	 */
	});
</script>
</html>
